

// function person(name) {
//     this.name = name
//     this.run = function () {
//         console.log(`${this.name}在跑步`)
//     }
// }
// person.prototype.age = 20

// function webs(name) {
//     person.call(this, name)
//     this.work = function () {
//         console.log(`${this.name}在跑步111`)
//     }
// }

// webs.prototype = new person("gg")
// var w = new webs()
// console.log(w.work())

class person {
    constructor(name) {
        this.name = name
    }
    getName() {
        return this.name
    }
    setName(name) {
        this.name = name
    }
    run() {
        console.log(`${this.name}跑在da路上`)
    }
}

class web extends person {
    constructor(name) {
        super(name)
    }
    run() {
        console.log(`${this.name}跑在xiao路上`)
    }
    work() {
        console.log(`${this.name}工作中`)
    }
}

var w = new web("李白")
w.work()